<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>白夜班日报计算</title>

</head>

<div class="price-form">
    <header>白班</header>
    <br/>

    <input type="number" id="bdlCount" placeholder="大连班人数"> <span>大连班人数</span> <br/>

    <input type="number" id="bxzCount" placeholder="行政班人数"> <span>行政班人数</span> <br/>

    <input type="number" id="bxyCount" placeholder="小夜班人数"> <span>小夜班人数</span> <br/>

    <input type="number" id="bltCount" placeholder="两头夜人数"> <span>两头夜人数</span> <br/>

    <br/>
    <input type="button" id="calculate" value="计算" placeholder="计算"> <br/>
    <input type="number" id="result"  placeholder="白班日报">
</div>
<br/>
<br/>
<div class="price-form">
    <header>夜班</header>
    <br/>
    <input type="number" id="ydlCount" placeholder="大连班人数"> <span>大连班人数</span> <br/>
    <input type="number" id="yxzCount" placeholder="行政班人数"> <span>行政班人数</span> <br/>
    <input type="number" id="yxyCount" placeholder="小夜班人数"> <span>小夜班人数</span> <br/>
    <input type="number" id="ydyount" placeholder="大夜班人数"> <span>大夜班人数</span> <br/>
    <input type="number" id="yltCount" placeholder="两头夜人数"> <span>两头夜人数</span> <br/>

    <br/>
    <input type="button" id="yCalculate" value="计算" placeholder="计算"> <br/>
    <input type="number" id="yResult"  placeholder="夜班日报">
</div>
<body>

<script type="text/javascript">
    window.onload = function(){
        var calculate = document.getElementById('calculate');
        var yCalculate = document.getElementById('yCalculate');

        calculate.onclick = function () {
            var bdlCount = document.getElementById('bdlCount').value;
            var bxzCount = document.getElementById('bxzCount').value;
            var bxyCount = document.getElementById('bxyCount').value;
            var bltCount = document.getElementById('bltCount').value;
            var resrult = 0;

            // bxCount + 7 * (a1Count + bCount + zlCount) +
            resrult = 9 * bdlCount + 7 * bxzCount + 0.5 * bxyCount + 0.5 * bltCount;
            resrult = resrult / 8;

            document.getElementById('result').value = resrult.toString();
        };

        yCalculate.onclick = function(){
            var ydyCount = document.getElementById('ydlCount').value;
            var yxzCount = document.getElementById('yxzCount').value;
            var yxyCount = document.getElementById('yxyCount').value;
            var ydyount = document.getElementById('ydyount').value;
            var yltCount = document.getElementById('yltCount').value;
            var yresrult = 0;

            // bxCount + 7 * (a1Count + bCount + zlCount) +
            yresrult = 0.5 * ydyCount + 0.5 * yxzCount + 6.5 * yxyCount + 8 * ydyount + 7 * yltCount;
            yresrult = yresrult / 8;

            document.getElementById('yResult').value = yresrult.toString();
        }
    }
</script>
</body>
</html>